using ClassDemo.Model.Entity;

namespace ClassDemo.Service;

/// <summary>
/// 教师服务接口
/// </summary>
public interface ITeacherService
{
    /// <summary>
    /// 获取所有教师
    /// </summary>
    /// <returns>教师列表</returns>
    Task<List<Teacher>> GetAllTeachersAsync();

    /// <summary>
    /// 根据ID获取教师
    /// </summary>
    /// <param name="id">教师ID</param>
    /// <returns>教师信息</returns>
    Task<Teacher?> GetTeacherByIdAsync(int id);

    /// <summary>
    /// 根据手机号获取教师
    /// </summary>
    /// <param name="mobile">手机号</param>
    /// <returns>教师信息</returns>
    Task<Teacher?> GetTeacherByMobileAsync(string mobile);

    /// <summary>
    /// 分页获取教师列表
    /// </summary>
    /// <param name="pageIndex">页码</param>
    /// <param name="pageSize">页大小</param>
    /// <param name="keyword">搜索关键词</param>
    /// <returns>分页结果</returns>
    Task<(List<Teacher> Data, int Total)> GetTeachersPageAsync(int pageIndex, int pageSize, string? keyword = null);

    /// <summary>
    /// 根据姓名搜索教师
    /// </summary>
    /// <param name="name">教师姓名</param>
    /// <returns>教师列表</returns>
    Task<List<Teacher>> SearchTeachersByNameAsync(string name);

    /// <summary>
    /// 添加教师
    /// </summary>
    /// <param name="teacher">教师信息</param>
    /// <returns>操作结果</returns>
    Task<(bool Success, string Message)> AddTeacherAsync(Teacher teacher);

    /// <summary>
    /// 更新教师信息
    /// </summary>
    /// <param name="teacher">教师信息</param>
    /// <returns>操作结果</returns>
    Task<(bool Success, string Message)> UpdateTeacherAsync(Teacher teacher);

    /// <summary>
    /// 删除教师
    /// </summary>
    /// <param name="id">教师ID</param>
    /// <returns>操作结果</returns>
    Task<(bool Success, string Message)> DeleteTeacherAsync(int id);

    /// <summary>
    /// 批量删除教师
    /// </summary>
    /// <param name="ids">教师ID列表</param>
    /// <returns>操作结果</returns>
    Task<(bool Success, string Message)> DeleteTeachersAsync(List<int> ids);
}